/**
 * Created by cxj on 2016/2/22.
 */
var grid;
define([
    "jquery",
    "IO",
    "bootbox"
], function($,IO,bootbox) {
    $(function () {

        //每列数据列性
        var columns = [
            {title : '编号',dataIndex :'User_ID',dataSource:function(data,datarow,gridobj,current_column) {

                return "<span>"+parseInt( (gridobj.current_page-1)*gridobj.page_rows+parseInt(datarow)+1)+"</span>";
            }},
            { title: '用户id', dataIndex: 'user_id',},
            { title: '手机号', dataIndex: 'mobile',},
            { title: '姓名', dataIndex: 'real_name',},
            { title: '平台总花费', dataIndex: 'total_expense',},
            { title: '总金额', dataIndex: 'balance',},
            { title: '提款中金额', dataIndex: 'balance_withdrawing',},
            { title: '可使用金额', dataIndex: 'balacan_cash',},
            { title: '订单收益', dataIndex: 'income_order',},
            { title: '平台收益', dataIndex: 'income_platform',},
            { title: '红包收益', dataIndex: 'income_purse',},
            { title: '注册时间', dataIndex: 'create_time',},


        ];


        //数组初始化

        function dataInit() {
            grid = new Grid("/user/getuserlist", $("#table_my_toast"), $("#paging_my_toast"), 1, 10, columns, get_input_param(), 20);

            //初始化
            grid.Init();
        }

        //获取输入框内容
        function get_input_param() {

            var param="mobile="+$("#mobile").val();

            return param;

        }
        dataInit();
        //查询
        $("#query").bind("click", function () {
            dataInit();
        });
    });


});